<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Untitled Document</title>
	<link rel="stylesheet" type="text/css" href="css/main.css" />
	<link rel="stylesheet" type="text/css" href="css/meniu.css" />
	<link rel="stylesheet" type="text/css" href="css/style.css" />

</h:head>
<h:body>

	<ui:include src="header.xhtml" />

	<h:panelGroup layout="block" id="content">

		<ui:include src="leftMenu.xhtml" />

		<h:panelGroup layout="block" id="contenRight">

			<h:panelGroup layout="block" id="header" style="margin-top: 20px;">
				<ul>
					<li id="selected"><a>View Report</a></li>
				</ul>
			</h:panelGroup>

			<h:panelGroup layout="block" id="contentTab">
				<h:form>
					<h:outputText
						value="Report Name: #{openReportBean.selectedReport.name}" />
					<br />
					<h:outputText
						value="Report Date: #{openReportBean.selectedReport.date}" />

					<br />
					<hr />
					<p:dataTable value="#{openReportBean.reportResultDTO}" var="row">
						<p:columns value="#{openReportBean.selectedColumns}" var="col">
							<f:facet name="header">
										#{col}
								</f:facet>
							<h:outputText value="#{row[col]}"
								rendered="#{!(col == 'dob' or col == 'medCheckUpDate' or col == 'employmentDate' or col == 'department')}" />
							<h:outputText value="#{row[col]}"
								rendered="#{col == 'dob' or col == 'medCheckUpDate' or col == 'employmentDate'}">
								<f:convertDateTime pattern="yyyy-MM-dd" />
							</h:outputText>
							<h:outputText value="#{row[col].name}"
								rendered="#{col == 'department'}">
							</h:outputText>
						</p:columns>
					</p:dataTable>
					<h:commandButton action="#{openReportBean.exportToXls}"
						value="Export Report" />
					<br />
				</h:form>
				<h:form>
					<br/>
					<h:commandButton action="manageReports.xhtml" value="Back" />
				</h:form>
			</h:panelGroup>
		</h:panelGroup>
	</h:panelGroup>
</h:body>
</html>